<!DOCTYPE html>
<html lang="en">
<head>
    <include file="Public:header" />
    <title></title>
</head>
<body>
    <div class="mb50 mt50">
        <p class="lhg-Registered"><input type="text"  placeholder="请输入手机号码" id="tel" /><a href="#this" onClick="send_code(this)">发送校验码</a></p>
        <p class="lhg-Registered"><input type="text"  id="code" placeholder="请填写手机校验码" /></p>
		 <p class="lhg-Registered"><input type="password" id="password1" type="text" placeholder="请设置登录密码" /></p>
		  <p class="lhg-Registered"><input type="password" id="password2" type="text" placeholder="请再次输入密码" /></p>
        <a href="#this" onClick="reg()" class="lhg-logo3" style="color: #bebebe;">提交</a>
    </div>
	
	<script type="text/javascript">
	function send_code(obj){
	  var tel=$("#tel").val();
	  $.getJSON("<{:U('Index/send_code')}>",{tel:tel},function(data){
	    if(data.error>0){
		   dialog(data.msg);
		}else{
		  time_wait(obj,1);
		  dialog(data.msg);
		 // $("#code").val(data.msg);
		}
	  })
	}
	/******注册*/
	function reg(){
	var password1= $("#password1").val();
	var password2= $("#password2").val();
	var tel= $("#tel").val();
	var code= $("#code").val();
	$.getJSON("<{:U('Index/register')}>",{tel:tel,code:code,password2:password2,password1:password1},function(data){
	    if(data.error>0){
		   dialog(data.msg);
		}else{
		   window.location.href="/Index/registersuc";
		}
	  })
	}
	</script>
		<div id="dialog1"></div>
	<div id="bg"></div>
	<div id="dialog"></div>
</body>
</html> 